home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
4671-5.790
/
dmg-4961
/
power
/
stoshelp.pwr
< prev
next >
Wrap
Text File
|
1989-12-31
|
14KB
|
403 lines
----------------------------------------------------------------------------
T H E
<<<<<>>>>> <<<<<>>>>> <<<<<>>>>> <<<<<>>>>>
<<<<< <<>> <<< >>> <<<<<
<<<<<>>>>> <<>> <<< >>> <<<<<>>>>>
>>>>> <<>> <<< >>> >>>>>
<<<<<>>>>> <<>> <<<<<>>>>> <<<<<>>>>>
A D V I C E B U R E A U
----------------------------------------------------------------------------
YOUR STOS-RELATED PROBLEMS ANSWERED BY
CHRIS SHARP OF SUPREME SOFTWARE
AND
DEANO OF SILLY SOFTWARE
----------------------------------------------------------------------------
Due to a corrupt disk (thanks Mr. ROYAL MAIL!) we are unable to print Chris
Sharp's answers to this months STOS problems but he IS still on the team
ready to answer your questions so if you have a STOS query and you would
like to send it to Chris Sharp of SUPREME SOFTWARE then write to the
following address:
CHRIS SHARP
SUPREME SOFTWARE
4 SUNNYCROFT LANE
DINAS POWYS
SOUTH GLAMORGAN
SOUTH WALES
CF64 4QQ
Or write to Deano of SILLY SOFTWARE at this address:
DEANO
SILLY SOFTWARE
27 TURBARY WALK
MILNROW
ROCHDALE
OL16 4JN
Or if the worst comes to the worst you can send your STOS problems to me at
the normal POWER address. Either way, your question(s) will be answered by
both Chris and Deano. Okay, here are this months questions...
****************************************************************************
Dear POWER,
I have a 520 STE upgraded to 1 meg and the following STOS
extensions:
BLITTER
STE
MISTY
QUICK
CONTROL
TRACKER
1. I am currently trying to code a RPG (captive style) but I am having
trouble. Please could you tell me the fastest way to do the following:
- Read the maze position and walls, door and baddies.
- Update position and bung it on the screen.
2. Is it possible to poke scores or graphics into the overscan area and if
so, how?
3. With a game like Space Invaders and Galaxians, what would be the best way
to check collisions?
4. How the hell do I get hold of the EXTRA Extension?
5. A friend of mine (the only other person in Thetford with a ST) just
bought the STOS compiler from a car bootsale and it doesn't have
instructions (no it's not a copy, I can prove it!) and I can't figure out
the following things:
- I can compile to basic and save it as a .CMP file how do you execute it?
- When compiling to GEM how do you load external datafiles (i.e. MBK's)
without it automatically adding them to the compiled .PRG?
6. In Pacman-type games, how do you give the ghosts intelligence to roam the
maze on their own?
7. What is your opinion of the 3D extension as I have been thinking about
getting it but I don't know how good it is?
8. When I registered the Misty Extension the registration disk had a routine
to display fullscreen pictures, I have corrupted my registration disk and
didn't make a backup, so could you please tell me how to do it?
Cheers.
From Lee Ashmore
DEANO OF SILLY SOFTWARE REPLIES:
Answer One...
The quickest way of reading things like exits and such in a maze of rooms is
to store all the info in arrays, then check which room the player is in and
set zones in that room. For example, the following routine shows us how to
set up zones in each room and set them up when the player enters it.
10 key off : curs off : mode 0
20 dim MAP(5,4) : dim XZ1(5,4),YZ1(5,4),XZ2(5,4),YZ2(5,4) : ROOM=1
25 rem SET UP MAP EXIT VALUES
30 for X=1 to 5 : for Y=1 to 4
40 read MAP(X,Y)
50 next Y : next X
52 rem SET UP ZONE CO-ORDINATES FOR EACH ROOM
55 for X=1 to 5 : for Y=1 to 4
66 read A,B,C,D
70 XZ1(X,Y)=A : YZ1(X,Y)=B : XZ2(X,Y)=C : YZ2(X,Y)=D
75 next Y : next X
76 rem DRAW EXIT BOXES AND INFO OF WHERE EACH ONE GOES
80 home : print "ROOM";ROOM : locate 0,6
90 for X=1 to 4
100 box XZ1(ROOM,X),YZ1(ROOM,X) to XZ2(ROOM,X),YZ2(ROOM,X)
110 set zone X,XZ1(ROOM,X),YZ1(ROOM,X) to XZ2(ROOM,X),YZ2(ROOM,X)
115 print "EXIT";X;" GOES TO ROOM";MAP(ROOM,X)
120 next X
125 rem WAIT FOR PLAYER TO CHOOSE A ZONE
130 repeat
140 EXIT=zone(0)
150 until EXIT<>0 and mouse key=1
155 rem SET ROOM VALUE TO NEW ROOM
160 ROOM=MAP(ROOM,EXIT) : goto 80
1000 rem EXIT VALUES FOR EACH OF THE FIVE ROOMS IN MAZE
1010 data 2,3,4,5
1020 data 1,2,3,4
1030 data 2,1,3,4
1040 data 3,2,1,5
1050 data 1,2,3,4
2000 rem ZONE CO-ORDINATES FOR ROOM ONE
2010 data 10,20,20,40
2020 data 30,20,40,40
2030 data 50,20,60,40
2040 data 70,20,80,40
2060 rem ZONE CO-ORDINATES FOR ROOM TWO
2070 data 10,20,20,40
2080 data 30,20,40,40
2090 data 50,20,60,40
2100 data 70,20,80,40
2120 rem ZONE CO-ORDINATES FOR ROOM THREE
2130 data 10,20,20,40
2140 data 30,20,40,40
2150 data 50,20,60,40
2160 data 70,20,80,40
2170 rem ZONE CO-ORDINATES FOR ROOM FOUR
2180 data 10,20,20,40
2190 data 30,20,40,40
2200 data 50,20,60,40
2210 data 70,20,80,40
2220 rem ZONE CO-ORDINATES FOR ROOM FIVE
2230 data 10,20,20,40
2240 data 30,20,40,40
2250 data 50,20,60,40
2260 data 70,20,80,40
In this routine we have five rooms in the maze, each with four exits which
all lead to other parts of the maze. The MAP array works like this, the
varible ROOM holds the number of the players position in the maze, in other
words the room number. The first set of data statements allow us to specify
which exit leads to which room. For example....
10 read MAP(1,1),MAP(1,2),MAP(1,3),MAP(1,4)
20 data 2,3,4,5
This means that exit one leads to room two, exit two leads to room three and
so on. When you run this routine you will see four boxes on screen,
representing four zones, or exits in this case. Clicking the left mouse key
in a zone will set the varible ROOM to the new destination room. With this
method you can easily tell where you are by just reading the ROOM varible.
With this you can then call up the part of the maze you want.
100 screen$(logic,16,0)=R$(ROOM)
The arrays XZ1, YZ1, XZ2, and YZ2 hold the co-ordinates of the exit boxes on
screen. The format goes.....
XZ1(ROOM,EXIT)
So we can set up four zones in the present room using the SET ZONE command
then check which zone the player chooses. The exit zones could be four
arrows pointing in four directions. Using this method you can check whats on
screen in this method. For example, if the player clicked on a baddie in
order to fight him, then you could say that the baddie is in room three and
is in zone two, and check like this.
10 repeat
20 CH=zone(0) : wait vbl
30 until CH<>0 and mouse key=1
40 if ROOM=3 and CH=2 then gosub 1000
Where line 1000 onwards holds the routine for fighting the baddie.
Answer Two....
I've never used any overscanning methods so I can't help you there. Maybe
Chris has the answer.....he's very clever you know.
Answer Three....
The best and fastest way of checking colisions would proberly be to use the
missing link MANY BOB and MANY OVERLAP commands. This allows you to have a
fair few bobs (preshifted sprites) flying around with fast checking.
Answer Four....
The EXTRA extension can be obtained by sending a disk of P.D. and return
postage to the author himself.
Martin Cubbit
14 Deepdene Avenue
Rayleigh
Essex
SS6 9LG
Its currently at version 2.10.
Answer Five....
A CMP file saved by the compiler can be treated the same as a BAS file. Just
load and run it as you would a BAS file. The only difference is that you
can't see the basic listing in a CMP file.
Errm, ho hum, well the compiler only loads the files it needs. If you don't
use sprites then it will ignore the SPRITE.BIN file, only adding the machine
code routines it needs to run sprites, windows, and so on. If you wanted to
load other files when the program is running from GEM then you just use the
LOAD command in the normal way. For example...
100 load"picture.mbk",5
If you don't want to keep this file in memory then you can simply erase the
bank with the ERASE command.
Answer Six....
It depends on what your using, either sprites or ML bobs. The thing I would
suggest (and hope it works), is to define your ghost sprite and place the
hot spot in the top left hand corner. Lets look at the sprite method.
Draw your maze using the MAP accessory and make note of the colour of the
background that the ghost moves over. This of course would be colour nought.
We can use a routine that tells the sprite to only move along that colour.
10 key off : hide on : flash off : curs off : mode 0
20 ROOM=1 : gosub 5000 : rem DRAW ROOM ONE OF THE MAP
30 sprite 1,40,72,1 : rem SPRITE STARTING POSITION
40 if movon(1)=0 then gosub 1000
50 gosub 2000
60 goto 40
1000 rem MOVE SPRITE IN CERTAIN DIRECTION
1010 if D=1 then move X 1,"(2,-1,1)"
1020 if D=2 then move X 1,"(2,1,1)"
1030 if D=3 then move Y 1,"(2,-1,1)"
1040 if D=4 then move Y 1,"(2,1,1)"
1050 move on 1 : return
2000 rem CHECK IF SPRITE AT DEAD END, IF SO, MOVE IT ANOTHER WAY
2010 X=xsprite(1) : y=ysprite(1) : S1=point(X,Y+8) : S2=point(X+16,Y+8) :
S3=point(X+8,Y) : S4=point(X+8,Y+8)
2020 if S1<>0 and D=1 then D=2
2030 if S2<>0 and D=2 then D=1
2040 if S3<>0 and D=3 then D=4
2050 if S4<>0 and D=4 then D=3
2060 return
As this routine has just come from a few guesses, I'm not sure if it will
actually work properly. However, with a bit of messing about it should be
okay. The routine works by checking the colour in front of the sprite, if
its different from the background colour then we use the varible D to change
direction. Unlike the DETECT command the POINT command allows us to check
any part of the sprite, so we can check all sides. I think Chris would
proberly give a better working routine of this anyway as I've just not add
time to work such a routine out.
Answer Seven....
STOS 3D is a pretty powerful package, but its down side is speed. Its also
not very easy to use. But I think its worth a try if you want to make your
own STOS 3D games.
Answer Eight....
I have sent you the MISTY registration disk to replace the copy you lost.
You'll have to get the routine from that as this kind of routine is beyond
me. Might you, I'll get there one day.
****************************************************************************
Dear POWER,
I have recently found out how limiting 15 banks in STOS can be but
I've heard of a method called 'stacking' which apparently lets you have as
many banks as you want in theory. How do I stack a bank and is there any
kind of limit or rules that have to be followed?
From Neil Simons
DEANO OF SILLY SOFTWARE REPLIES:
Think of a large box, this allows us to put more than one item in it. Its
the same with banks, we can actually set the size of it then load the files
into it one after another. This method with stack PAC pictures.
First make a note of the length of each PAC file then add them all together,
then add about twenty bytes and make it an even number. You then choose a
bank and reserve it to this size.
10 reserve as data 5,80000
Note reserving a work bank makes it a tempory bank while reserving a data
bank means it can be saved along with your program.
Load the first file in like this.
20 load"pic1.pac",start(5)
Now the next thing to do is load the next picture into the position where
the last picture ends. So, get the length of the first file and make it into
an even number. For example, if the file is 1787 bytes long then call it
1790 bytes long. We can now load the second file in, in front of the first
file just like this.
30 load"pic2.pac",start(5)+1790
After this we just take the length of the pictures already loaded and load
the next picture in. For example, lets say our pictures are like this.
PIC1.PAC LENGTH 1787 ROUNDED TO EVEN 1790
PIC2.PAC LENGTH 2136 ROUNDED TO EVEN 2140
We take these two values and add them together, which makes 3930. If the
value is an odd number then you must make it even. We can then load this
file in.
30 load "pic3.pac",start(5)+3930
Do the same with the other files already loaded, add them together and round
them up to even numbers to find where to load the next picture in.
To get at them, all you have to do is this.
40 unpack 5 : rem unpack the first picture
50 unpack start(5)+3930 : rem unpack picture three
There is an easier method if you have the missing link extension. This has
two commands called BANK LOAD and BANK COPY. Use the MAKEBANK program on the
source disk to load all files and save them as an FBANK with the extension
BNK. You can then load and use them like this.
10 mode 0 : key off : flash off : curs off
20 PICNO=1
30 reserve as work 5,80000
40 bload"pics.bnk",5
50 reserve as work 6,9000
60 bank copy start(5),start(6),PICNO
70 unpack 6
This copies the specified picture from the stacked bank into bank six and
unpacks it to the screen. You can use this method with the smaller files but
it tends to corrupt some larger ones. The first method however should work
with all files. In case you were wondering, the BANK LOAD command allows you
to load a file from a stacked bank on disk.
******************************************************************************